COPY FROM FORMAT CSV FORCE_NULL(*) ?

  • Jump to comment-1
    jian.universality@gmail.com2022-07-25T04:18:12+00:00
    Hi, there. copy force null git commit <https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=3b5e03dca2afea7a2c12dbc8605175d0568b5555> didn't attach a discussion link. So I don't know if it's already been discussed. Current seem you cannot do COPY forcetest FROM STDIN WITH (FORMAT csv, FORCE_NULL(*)); can we have FORCE_NULL(*)? Since We already have FORCE_QUOTE(*). -- I recommend David Deutsch's <<The Beginning of Infinity>> Jian
    • Jump to comment-1
      andrew@dunslane.net2022-07-25T13:28:24+00:00
      On 2022-07-25 Mo 00:18, jian he wrote: > Hi, there. > > copy force null git commit > <https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=3b5e03dca2afea7a2c12dbc8605175d0568b5555> > didn't attach a discussion link. So I don't know if it's already been > discussed. > > Current seem you cannot do >     COPY forcetest  FROM STDIN WITH (FORMAT csv,  FORCE_NULL(*)); > > can we have FORCE_NULL(*)? Since We already have FORCE_QUOTE(*).  > We only started adding discussion links in later years. Here's a link to the original discussion. <https://www.postgresql.org/message-id/flat/CAB8KJ%3DjS-Um4TGwenS5wLUfJK6K4rNOm_V6GRUj%2BtcKekL2%3DGQ%40mail.gmail.com> Offhand I don't see why we shouldn't have this. Someone interested enough would need to submit a patch. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com
      • Jump to comment-1
        zmlpostgres@gmail.com2022-07-28T14:09:42+00:00
        Hi, Agree, FORCE_NULL(*) is useful as well as FORCE_NOT_NULL(*). We can have them both. They are useful when users copy tables that have many columns. Regards, Zhang Mingli On Jul 25, 2022, 21:28 +0800, Andrew Dunstan <andrew@dunslane.net>, wrote: > > On 2022-07-25 Mo 00:18, jian he wrote: > > Hi, there. > > > > copy force null git commit > > <https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=3b5e03dca2afea7a2c12dbc8605175d0568b5555> > > didn't attach a discussion link. So I don't know if it's already been > > discussed. > > > > Current seem you cannot do > >     COPY forcetest  FROM STDIN WITH (FORMAT csv,  FORCE_NULL(*)); > > > > can we have FORCE_NULL(*)? Since We already have FORCE_QUOTE(*). > > > > We only started adding discussion links in later years. Here's a link to > the original discussion. > > > <https://www.postgresql.org/message-id/flat/CAB8KJ%3DjS-Um4TGwenS5wLUfJK6K4rNOm_V6GRUj%2BtcKekL2%3DGQ%40mail.gmail.com> > > > Offhand I don't see why we shouldn't have this. Someone interested > enough would need to submit a patch. > > > cheers > > > andrew > > > -- > Andrew Dunstan > EDB: https://www.enterprisedb.com > > >